import time
def buble(mas):
    flag = True
    while flag == True:
        flag = False
        for j in range(len(mas)):
            for i in range(len(mas) - 1 - j):
                if int(mas[i]) > int(mas[i + 1]):
                    mas[i], mas[i + 1] = mas[i + 1], mas[i]
    return mas
f = open('m3_shuffle.txt')
array = f.readlines()

t_start = time.time()
x = buble(array)
t_finish = time.time()
print('Время', round((t_finish-t_start))*1000,'мc')

f1 = open('m1_sorted.txt')
array1 = f1.readlines()

t_start = time.time()
x1 = buble(array1)
t_finish = time.time()
print('Время1', round((t_finish-t_start))*1000,'мc')

f1 = open('m1_reverse.txt')
array2 = f1.readlines()

t_start = time.time()
x2 = buble(array2)
t_finish = time.time()
print('Время1', round((t_finish-t_start))*1000,'мc')

